//
//  Teletext.swift
//  SearchBarView
//
//  Created by liaokylin on 2024/10/13.
//

import SwiftUI

struct Teletext: View {
    @State var isPresented = false
    
    var body: some View {
        VStack {
            NavigationLink(
                destination: CookbookDetails(),
                label: {
                    VStack{
                        Image("2")
                            .resizable()
                            .scaledToFit()
                            .cornerRadius(10)
                        HStack{
                            Text("宫保鸡丁").font(.subheadline).bold().foregroundColor(Color("fontColor"))
                            Spacer()
                        }
                    }
                })
            HStack{
                NavigationLink {
                    Gastronome()
                } label: {
                    Image("3")
                        .frame(width: 20,height: 20)
                        .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/)
                    Text("可爱的胖秀").font(.caption2).foregroundColor(Color("fontColor").opacity(0.5))
                }
                Spacer()
                Image(systemName: "ellipsis").foregroundColor(.gray)
                    .sheet(isPresented: $isPresented, content: {
                        VStack{
                            HStack{
                                Text("对这么内容的反馈")
                                Spacer()
                                Image(systemName: "x.circle")
                                    .onTapGesture {
                                        isPresented = false
                                    }
                            }.padding()
                            Spacer()
                            Text("不想看到这个内容")
                            Spacer()
                        }
                        .presentationDetents([.height(200)])
                        .toolbar{
                            ToolbarItem{
                         
                            }
                        }
           
                    })
                    .onTapGesture {
                        isPresented = true
                    }
            }
        }.frame(width:  UIScreen.main.bounds.width/2 - 15)
    }
}


#Preview {
    Teletext(isPresented: false)
}
